/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb020_emp_prfa")
public class EmpreendimentoPrefeitura implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_VNCLO")
    private Integer nuSqnclVnclo;
    @JoinColumn(name = "NU_CNPJ_PREF", referencedColumnName = "NU_CNPJ_PREF")
    @ManyToOne(optional = false)
    private Prefeitura nuCnpjPref;
    @JoinColumn(name = "CO_APF", referencedColumnName = "CO_APF")
    @ManyToOne(optional = false)
    private Empreendimento coApf;

    public EmpreendimentoPrefeitura() {
    }

    public EmpreendimentoPrefeitura(Integer nuSqnclVnclo) {
        this.nuSqnclVnclo = nuSqnclVnclo;
    }

    public Integer getNuSqnclVnclo() {
        return nuSqnclVnclo;
    }

    public void setNuSqnclVnclo(Integer nuSqnclVnclo) {
        this.nuSqnclVnclo = nuSqnclVnclo;
    }

    public Prefeitura getNuCnpjPref() {
        return nuCnpjPref;
    }

    public void setNuCnpjPref(Prefeitura nuCnpjPref) {
        this.nuCnpjPref = nuCnpjPref;
    }

    public Empreendimento getCoApf() {
        return coApf;
    }

    public void setCoApf(Empreendimento coApf) {
        this.coApf = coApf;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nuSqnclVnclo != null ? nuSqnclVnclo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmpreendimentoPrefeitura)) {
            return false;
        }
        EmpreendimentoPrefeitura other = (EmpreendimentoPrefeitura) object;
        if ((this.nuSqnclVnclo == null && other.nuSqnclVnclo != null) || (this.nuSqnclVnclo != null && !this.nuSqnclVnclo.equals(other.nuSqnclVnclo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.EmpreendimentoPrefeitura[ nuSqnclVnclo=" + nuSqnclVnclo + " ]";
    }
    
}
